/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author lzw
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface FstPaymentRecord extends BasicModel<FstPaymentRecord> {
  userName?: string; // 员工名称
  userId?: string; // 员工id
  years?: string; // 年度
  yearsMoney?: number; // 年度总回款
  oneMoney?: number; // 1月回款
  twoMoney?: number; // 2月回款
  threeMoney?: number; // 3月回款
  fourMoney?: number; // 4月回款
  fiveMoney?: number; // 5月回款
  sixMoney?: number; // 6月回款
  sevenMoney?: number; // 7月回款
  eightMoney?: number; // 8月回款
  nineMoney?: number; // 9月回款
  tenMoney?: number; // 10月回款
  elevenMoney?: number; // 11月回款
  twelveMoney?: number; // 12月回款
  dayMoney?: number; // 当天回款
}

export const fstPaymentRecordList = (params?: FstPaymentRecord | any) =>
  defHttp.get<FstPaymentRecord>({ url: adminPath + '/operating/fstPaymentRecord/list', params });

export const fstPaymentRecordListData = (params?: FstPaymentRecord | any) =>
  defHttp.post<Page<FstPaymentRecord>>({ url: adminPath + '/operating/fstPaymentRecord/listData', params });

export const fstPaymentRecordForm = (params?: FstPaymentRecord | any) =>
  defHttp.get<FstPaymentRecord>({ url: adminPath + '/operating/fstPaymentRecord/form', params });

export const fstPaymentRecordSave = (params?: any, data?: FstPaymentRecord | any) =>
  defHttp.postJson<FstPaymentRecord>({ url: adminPath + '/operating/fstPaymentRecord/save', params, data });

export const fstPaymentRecordImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/operating/fstPaymentRecord/importData',
      onUploadProgress,
    },
    params,
  );

export const fstPaymentRecordDelete = (params?: FstPaymentRecord | any) =>
  defHttp.get<FstPaymentRecord>({ url: adminPath + '/operating/fstPaymentRecord/delete', params });
